﻿var url;
var emptyId = "00000000-0000-0000-0000-000000000000";

function init()
{
    url = window.location.href;
    extraInit();
}

function extraInit()
{
}

function refresh()
{
    window.location.href = url;
}

function randomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}

function mask()
{
    var contentDiv = $("div[class=content]");
    contentDiv.mask("Đang xử lý...");
    return contentDiv;
}

function unmask(area)
{
    area.unmask();
}

function createFormat(count)
{
    var temp = "" + count;
    var result = "";
    for (var i=0; i<temp.length; i++)
    {
        result += '0';
    }
    return result;
}

function unformat(number)
{
    var result = "" + number;
    for (var i=0; i<result.length; i++)
    {
        var c = result.charAt(i);
        if(((c>=0) && (c<=9)) || (c==','))
        {
        }
        else
        {
            result = result.substring(0,i)+result.substring(i+1,result.length);
            i--;
        }
    }
    return result;
}